package com.tony.api;
import com.tony.model.DeviceInfo;
import com.tony.model.Task;
import com.tony.utils.HttpUtil;
import com.tony.utils.TextUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;

public class ApiVoteAll {


    public int threadNum;

    private String username;
    private String password;
    private int itemId;
    private String dPath;

    private int votePlayerTimes=1;
    private int voteCropsTimes=1;

    private long minId;
    private long maxId;



    public static void main(String[] args){

    }



    public boolean voteTest(){
        for(long id=minId;id<=maxId;id++){
            String aid="6221022617988498432";
            String uid=String.valueOf(id);

            DeviceInfo deviceInfo=DeviceInfo.getInstances(dPath).getData();
            if(deviceInfo==null){
                System.out.println("获取设备信息失败");
                continue;
            }

            String token=getToken(uid,deviceInfo);
            if(TextUtil.isEmpty(token)){
                System.out.println("获取token失败");
                continue;
            }



            Task task=Task.getInstances(dPath).getData();
            if(task==null){
                continue;
            }

            boolean isSuccess = false;

            if(task.getPlayer_start()==1){//开启会员投票
                System.out.println("第【"+(this.threadNum+1)+"】个线程，队员【"+task.getPlayName()+"】的投票开始！！");
                isSuccess=voteByType(task.getPlayerId(),1,uid,token,aid);
                if(isSuccess){
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，队员【"+task.getPlayName()+"】的第【"+votePlayerTimes+"】次投票成功！！");
                }else{
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，队员【"+task.getPlayName()+"】的第【"+votePlayerTimes+"】次投票失败！！");
                }
                votePlayerTimes++;
            }

            if(task.getCorps_start()==1){
                System.out.println("第【"+(this.threadNum+1)+"】个线程，战队【"+task.getCorpsName()+"】的投票开始！！");
                isSuccess=voteByType(task.getCorpsId(),2,uid,token,aid);
                if(isSuccess){
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，战队【"+task.getCorpsName()+"】的第【"+voteCropsTimes+"】次投票成功！！");
                }else{
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，战队【"+task.getCorpsName()+"】的第【"+voteCropsTimes+"】次投票失败！！");
                }
                voteCropsTimes++;
            }
        }
        return true;
    }






    public boolean vote(){

        while (true){

            DeviceInfo deviceInfo=DeviceInfo.getInstances(dPath).getData();
            if(deviceInfo==null){
                System.out.println("获取设备信息失败");
                continue;
            }
            System.out.println("获取设备信息成功");

            String uid=getUid(deviceInfo);
            if(TextUtil.isEmpty(uid)){
                System.out.println("获取uid失败");
                continue;
            }
            System.out.println("获取uid成功");
            String token=getToken(uid,deviceInfo);
            if(TextUtil.isEmpty(token)){
                System.out.println("获取token失败");
                continue;
            }
            System.out.println("获取token成功");
            String aid=getAid(deviceInfo);
            if(TextUtil.isEmpty(aid)){
                System.out.println("获取aid失败");
                continue;
            }
            System.out.println("获取aid成功");

            JSONArray jsonArray2=getHomePage(uid,aid,token);
            if(jsonArray2==null||jsonArray2.size()<=0){
                System.out.println("进入首页授权页面失败");
                continue;
            }
            System.out.println("进入首页授权页面成功");

            String imgUrl=getCodeUrl(uid,aid,token);
            if(TextUtil.isEmpty(imgUrl)){
                System.out.println("获取验证码地址失败");
                continue;
            }

            String imgCode=getCode(imgUrl);
            if(TextUtil.isEmpty(imgCode)){
                System.out.println("获取验证码");
                continue;
            }

            //初始化登录打码平台的参数
            ApiPhoneCode apiPhoneCode=new ApiPhoneCode(username,password,itemId);
            String phoneToken=apiPhoneCode.login();
            if(TextUtil.isEmpty(phoneToken)){
                System.out.println("登录打码平台失败");
                continue;
            }
            System.out.println("登录打码平台成功");
            boolean isSuccess = false;
            String phone = null ;
            while (!isSuccess){
                phone=apiPhoneCode.getPhone(phoneToken);
                if(TextUtil.isEmpty(phone)){
                    System.out.println("获取电话号码失败");
                    continue;
                }
                System.out.println("获取电话号码成功");

                int count=0;
                while (!isSuccess){
                    isSuccess=bindPhone(uid,token,aid,phone,imgCode);
                    if(isSuccess){
                        break;
                    }else{
                        count++;
                        if(count > 2){
                            System.out.println("号码绑定失败");
                            break;
                        }
                        TextUtil.sleep(10);
                    }
                }
                if(!isSuccess){
                    TextUtil.sleep(10);
                    continue;
                }
                System.out.println("号码绑定成功");

            }




            String code=apiPhoneCode.getCode(phone,phoneToken);
            if(TextUtil.isEmpty(code)){
                System.out.println("获取验证码失败");
                continue;
            }
            System.out.println("获取验证码成功");

            isSuccess=false;
            int count=0;
            while (!isSuccess){
                isSuccess=checkCode(uid,token,aid,phone,code,imgCode);
                if(isSuccess){
                    break;
                }else{
                    count++;
                    if(count > 10){
                        System.out.println("验证码校验失败");
                        break;
                    }
                    TextUtil.sleep(10);
                }
            }
            if(!isSuccess){
                System.out.println("验证码校验失败");
                continue;
            }
            System.out.println("验证码校验成功");


            Task task=Task.getInstances(dPath).getData();
            if(task==null){
                continue;
            }

            if(task.getPlayer_start()==1){//开启会员投票
                System.out.println("第【"+(this.threadNum+1)+"】个线程，队员【"+task.getPlayName()+"】的投票开始！！");
                isSuccess=voteByType(task.getPlayerId(),1,uid,token,aid);
                if(isSuccess){
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，队员【"+task.getPlayName()+"】的第【"+votePlayerTimes+"】次投票成功！！");
                }else{
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，队员【"+task.getPlayName()+"】的第【"+votePlayerTimes+"】次投票失败！！");
                }
                votePlayerTimes++;
            }

            if(task.getCorps_start()==1){
                System.out.println("第【"+(this.threadNum+1)+"】个线程，战队【"+task.getCorpsName()+"】的投票开始！！");
                isSuccess=voteByType(task.getCorpsId(),2,uid,token,aid);
                if(isSuccess){
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，战队【"+task.getCorpsName()+"】的第【"+voteCropsTimes+"】次投票成功！！");
                }else{
                    System.out.println("第【"+(this.threadNum+1)+"】个线程，战队【"+task.getCorpsName()+"】的第【"+voteCropsTimes+"】次投票失败！！");
                }
                voteCropsTimes++;
            }

            System.out.println("投票结束");

        }
    }


    //获取用户的uid
    public String getUid(DeviceInfo deviceInfo){
        try {
            String url="https://a0.news.ghwx.com.cn/server/user/v1.1";

            JSONObject json=new JSONObject();
            json.put("imei",deviceInfo.imei);
            json.put("imsi",deviceInfo.imsi);
            json.put("iccid","");
            json.put("wifimac",deviceInfo.wifiMac);
            json.put("androidsdk",deviceInfo.sdkVersion);
            json.put("model",deviceInfo.model);
            json.put("manufacturer",deviceInfo.manufacture);
            json.put("fingerprint",deviceInfo.fingerprint);

            Map<String,String> headerMap=new HashMap<>();
            headerMap.put("Content-Type","application/json; charset=utf-8");
            headerMap.put("device",json.toString());
            headerMap.put("User-Agent","okhttp/3.8.1");
            headerMap.put("vendor","4611694814524604416");

            String result=HttpUtil.getInstance(false,false).sendPost(url,headerMap,"");
            if(!TextUtil.isEmpty(result)){
                JSONObject data=JSONObject.fromObject(result);
                if(data!=null&&data.has("uid")){
                    String uid=data.getString("uid");
                    return uid;
                }
            }
        }catch (Exception e){
            System.err.println("获取uid异常");
        }
        return null;
    }


    //获取token
    public String getToken(String uid,DeviceInfo deviceInfo){
        try {
            String url="https://a0.news.ghwx.com.cn/server/user/token/gen?uid="+uid;
            Map<String,String> map=new HashMap();
            map.put("User-Agent","Dalvik/2.1.0 (Linux; U; Android "+deviceInfo.releaseVersion+"; EML Build/"+deviceInfo.model+")");
            String result=HttpUtil.getInstance(false,false).sendGet(url,map);
            if(!TextUtil.isEmpty(result)){
                JSONObject json=JSONObject.fromObject(result);
                if(json!=null&&json.has("token")){
                    String token=json.getString("token");
                    return token;
                }
            }
        }catch (Exception e){
            System.err.println("获取token异常");
        }

        return null;
    }


    //获取aid
    public String getAid(DeviceInfo deviceInfo){
        try {
            String url="https://a0.news.ghwx.com.cn/server/ad/open";
            Map<String,String> map=new HashMap();
            map.put("User-Agent","Dalvik/2.1.0 (Linux; U; Android "+deviceInfo.releaseVersion+"; EML Build/"+deviceInfo.model+")");
            String result=HttpUtil.getInstance(false,false).sendGet(url,map);
            if(!TextUtil.isEmpty(result)){
                JSONObject json=JSONObject.fromObject(result);
                if(json!=null&&json.has("list")){
                    JSONArray jsonArray=json.getJSONArray("list");
                    if(jsonArray!=null&&jsonArray.size()>0){
                        for(int i=0;i<jsonArray.size();i++){
                            JSONObject data= (JSONObject) jsonArray.get(i);
                            if(data!=null&&data.has("title")&&data.getString("title").contains("股东来了")&&data.has("aid")){
                                String aid=data.getString("aid");
                                return aid;
                            }
                        }

                    }
                }
            }
        }catch (Exception e){
            System.err.println("获取aid异常");
        }

        return null;
    }

    //获取主页面
    public JSONArray getHomePage(String uid,String aid,String token){
        try {
            String url="https://h5live.cctvht.cn/cctvgdll/getHome.php";
            Map<String,String> headerMap=new HashMap<>();
            headerMap.put("Accept","application/json, text/plain, */*");
            headerMap.put("Origin","https://h5live.cctvht.cn");
            headerMap.put("User-Agent","Mozilla/5.0 (Linux; Android 7.0; STF-AL00 Build/HUAWEISTF-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36");
            headerMap.put("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
            headerMap.put("Referer"," https://h5live.cctvht.cn/shareholder/");
            //headerMap.put("Accept-Encoding","gzip, deflate");
            headerMap.put("Accept-Language","zh-CN,en-US;q=0.8");
            headerMap.put("X-Requested-With"," com.cctv.caijing");

            String params="yscj_uid="+uid+"&yscj_token="+token+"&yscj_aid="+aid+"&uid="+uid+"&token="+token+"&aid="+aid+"&opemid="+uid;
            String result=HttpUtil.getInstance(false,false).sendPost(url,headerMap,params);
            if(!TextUtil.isEmpty(result)){
                JSONArray jsonArray=JSONArray.fromObject(result);
                if(jsonArray!=null&&jsonArray.size()>0){
                    return jsonArray;
                }
            }
        }catch (Exception e){
            System.err.println("进入主界面异常");
        }

        return null;
    }


    public String getCodeUrl(String uid,String aid,String token){
        try {
            String url="https://h5api.cctvht.cn/api/Worldcup/getcaptchaimgbyggll";
            Map<String,String> headerMap=new HashMap<>();
            headerMap.put("Accept","application/json, text/plain, */*");
            headerMap.put("Origin","https://h5live.cctvht.cn");
            headerMap.put("User-Agent","Mozilla/5.0 (Linux; Android 7.0; STF-AL00 Build/HUAWEISTF-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36");
            headerMap.put("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
            headerMap.put("Referer"," https://h5live.cctvht.cn/shareholder/");
            //headerMap.put("Accept-Encoding","gzip, deflate");
            headerMap.put("Accept-Language","zh-CN,en-US;q=0.8");
            headerMap.put("X-Requested-With"," com.cctv.caijing");

            String params="imgToken="+uid+"&uid="+uid+"&token="+token+"&aid="+aid+"&openid="+uid;
            String result=HttpUtil.getInstance(false,false).sendPost(url,headerMap,params);
            if(!TextUtil.isEmpty(result)){
                JSONObject jsonObject=JSONObject.fromObject(result);
                if(jsonObject!=null&&jsonObject.has("code")&&jsonObject.getInt("code")==200&&jsonObject.has("data")){
                    JSONObject data=jsonObject.getJSONObject("data");
                    if(data!=null&&data.has("url")){
                        String dataUrl=TextUtil.urlDecode(data.getString("url"));
                        System.out.println(dataUrl);
                        return dataUrl;
                    }
                }
            }
        }catch (Exception e){
            System.err.println("获取验证码真实路径异常");
        }

        return null;
    }


    public String getCode(String imgUrl){
        try {

            String picName=dPath.substring(0,dPath.lastIndexOf("\\")+1);
            HttpClient httpClient = new HttpClient();
            GetMethod getMethod = new GetMethod(imgUrl);
            int statusCode = httpClient.executeMethod(getMethod);
            if (statusCode != HttpStatus.SC_OK) {
                System.err.println("Method failed: " + getMethod.getStatusLine());
                return null;
            }

            File filepic=new File(picName);
            if(!filepic.exists()){
                filepic.mkdir();
            }
            String fileName=picName+threadNum+System.currentTimeMillis()+".png";
            File filepicF=new File(fileName);
            InputStream inputStream = getMethod.getResponseBodyAsStream();
            OutputStream outStream = new FileOutputStream(filepicF);
            IOUtils.copy(inputStream, outStream);
            outStream.close();


            String url="http://op.juhe.cn/vercode/index?codeType=1004&dtype=&key=1740d436993b8a79f53c3b3dbad6c5b3&image=&base64Str="+TextUtil.urlEncode(TextUtil.getImageStr(fileName));
            //System.out.println(url);
            Map<String,String> headerMap=new HashMap<>();
            headerMap.put("Content-Type","application/json; charset=UTF-8");

            String result=HttpUtil.getInstance(false,false).sendGet(url,headerMap);
            System.out.println(result);
            if(!TextUtil.isEmpty(result)){
                JSONObject jsonObject=JSONObject.fromObject(result);
                if(jsonObject!=null&&jsonObject.has("error_code")&&jsonObject.getInt("error_code")==0&&jsonObject.has("result")){
                    String code=jsonObject.getString("result");
                    System.out.println(code);
                    return code;
                }
            }
        }catch (Exception e){
            System.out.println("请求而聚合数据异常");
        }
        return null;
    }

    //绑定手机号码
    public boolean bindPhone(String uid,String token,String aid,String phone,String imgCode){
        try {
            String url="https://h5live.cctvht.cn/cctvgdll/bangDing.php";
            Map<String,String> headerMpa=new HashMap<>();
            headerMpa.put("Accept","application/json, text/plain, */*");
            headerMpa.put("Origin","https://h5live.cctvht.cn");
            headerMpa.put("User-Agent","Mozilla/5.0 (Linux; Android 7.0; STF-AL00 Build/HUAWEISTF-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36");
            headerMpa.put("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
            headerMpa.put("Referer"," https://h5live.cctvht.cn/shareholder/");
            //headerMpa.put("Accept-Encoding","gzip, deflate");
            headerMpa.put("Accept-Language","zh-CN,en-US;q=0.8");
            headerMpa.put("X-Requested-With"," com.cctv.caijing");

            String params="uid="+uid+"&mobile="+phone+"&vcode="+imgCode+"&token="+token+"&aid="+aid+"openid="+uid;
            String result=HttpUtil.getInstance(false,false).sendPost(url,headerMpa,params);
            System.out.println(result);
            return getResult(result);
        }catch (Exception e){
            System.err.println("绑定手机号码异常");
        }

        return false;
    }

    public boolean getResult(String result){
        if(!TextUtil.isEmpty(result)){
            JSONObject jsonObject=JSONObject.fromObject(result);
            if(jsonObject!=null&&jsonObject.has("errno")&&jsonObject.getInt("errno")==1){
                System.out.println(jsonObject.getString("errmsg"));
                return true;
            }
        }
        return false;
    }


    //提交验证码
    public boolean checkCode(String uid,String token,String aid,String phone,String code,String imgCode){
        try {
            String url="https://h5live.cctvht.cn/cctvgdll/bangDingPush.php ";
            Map<String,String> headerMpa=new HashMap<>();
            headerMpa.put("Accept","application/json, text/plain, */*");
            headerMpa.put("Origin","https://h5live.cctvht.cn");
            headerMpa.put("User-Agent","Mozilla/5.0 (Linux; Android 7.0; STF-AL00 Build/HUAWEISTF-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36");
            headerMpa.put("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
            headerMpa.put("Referer"," https://h5live.cctvht.cn/shareholder/");
            //headerMpa.put("Accept-Encoding","gzip, deflate");
            headerMpa.put("Accept-Language","zh-CN,en-US;q=0.8");
            headerMpa.put("X-Requested-With"," com.cctv.caijing");

            String params="uid="+uid+"&mobile="+phone+"&code="+code+"&vcode="+imgCode+"&token="+token+"&aid="+aid+"&openid="+uid;
            String result=HttpUtil.getInstance(false,false).sendPost(url,headerMpa,params);
            return getResult(result);
        }catch (Exception e){
            System.out.println("校验验证码异常");
        }

        return false;
    }

    //获取选手列表
    public JSONArray getPlayerList(String uid,String token,String aid){
        try {
            String url="https://h5live.cctvht.cn/cctvgdll/getPlayerlist.php";
            Map<String,String> headerMpa=new HashMap<>();
            headerMpa.put("Accept","application/json, text/plain, */*");
            headerMpa.put("Origin","https://h5live.cctvht.cn");
            headerMpa.put("User-Agent","Mozilla/5.0 (Linux; Android 7.0; STF-AL00 Build/HUAWEISTF-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36");
            headerMpa.put("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
            headerMpa.put("Referer"," https://h5live.cctvht.cn/shareholder/");
            // headerMpa.put("Accept-Encoding","gzip, deflate");
            headerMpa.put("Accept-Language","zh-CN,en-US;q=0.8");
            headerMpa.put("X-Requested-With"," com.cctv.caijing");

            String params="uid="+uid+"&token="+token+"&aid="+aid+"&openid="+uid;
            String resulr=HttpUtil.getInstance(false,false).sendPost(url,headerMpa,params);
            if(!TextUtil.isEmpty(resulr)){
                JSONArray jsonArray=JSONArray.fromObject(resulr);
                if(jsonArray!=null&&jsonArray.size()>0){
                    return jsonArray;
                }
            }
        }catch (Exception e){
            System.err.println("获取参赛选手列表异常");
        }

        return null;
    }


    //获取战队列表
    public JSONArray getCorpsList(String uid,String token,String aid){
        try {
            String url="https://h5live.cctvht.cn/cctvgdll/getCorpslist.php";
            Map<String,String> headerMpa=new HashMap<>();
            headerMpa.put("Accept","application/json, text/plain, */*");
            headerMpa.put("Origin","https://h5live.cctvht.cn");
            headerMpa.put("User-Agent","Mozilla/5.0 (Linux; Android 7.0; STF-AL00 Build/HUAWEISTF-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36");
            headerMpa.put("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
            headerMpa.put("Referer"," https://h5live.cctvht.cn/shareholder/");
            //headerMpa.put("Accept-Encoding","gzip, deflate");
            headerMpa.put("Accept-Language","zh-CN,en-US;q=0.8");
            headerMpa.put("X-Requested-With"," com.cctv.caijing");

            String params="uid="+uid+"&token="+token+"&aid="+aid+"&openid="+uid;
            String resulr=HttpUtil.getInstance(false,false).sendPost(url,headerMpa,params);
            if(!TextUtil.isEmpty(resulr)){
                JSONArray jsonArray=JSONArray.fromObject(resulr);
                if(jsonArray!=null&&jsonArray.size()>0){
                    return jsonArray;
                }
            }
        }catch (Exception e){
            System.out.println("获取参赛战队列表异常");
        }

        return null;
    }



    public boolean voteByType(int itemId,int type,String uid,String token,String aid){
        try {

            JSONArray jsonArray=null;
            if(type==1){
                jsonArray=getPlayerList(uid,token,aid);
            }else if(type==2){
                jsonArray=getCorpsList(uid,token,aid);
            }

            if(jsonArray==null||jsonArray.size()==0){
                return  false;
            }

            String code="";
            for(int i=0;i<jsonArray.size();i++){
                JSONObject jsonObject=jsonArray.getJSONObject(i);
                if(jsonObject!=null&&jsonObject.has("playerInfoCode")){
                    code=jsonObject.getString("playerInfoCode");
                    break;
                }
            }


            String url="https://h5live.cctvht.cn/cctvgdll/pushVote.php";
            Map<String,String> headerMpa=new HashMap<>();
            headerMpa.put("Accept","application/json, text/plain, */*");
            headerMpa.put("Origin","https://h5live.cctvht.cn");
            headerMpa.put("User-Agent","Mozilla/5.0 (Linux; Android 7.0; STF-AL00 Build/HUAWEISTF-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36");
            headerMpa.put("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
            headerMpa.put("Referer"," https://h5live.cctvht.cn/shareholder/");
            //headerMpa.put("Accept-Encoding","gzip, deflate");
            headerMpa.put("Accept-Language","zh-CN,en-US;q=0.8");
            headerMpa.put("X-Requested-With"," com.cctv.caijing");

            String params="id="+itemId+"&type="+type+"&uid="+uid+"&playerInfoCodes="+code+"&token="+token+"&aid="+aid+"&openid="+uid;

            while (true){
                String result=HttpUtil.getInstance(false,false).sendPost(url,headerMpa,params);
                if(getResult(result)){
                    System.out.println("the 【"+voteCropsTimes+"】 vote success");
                    voteCropsTimes++;
                    continue;
                }else{
                    break;
                }
            }

            if(voteCropsTimes>1){
                return true;
            }
        }catch (Exception e){
            System.err.println("投票异常");
        }

        return false;
    }

    public long getMinId() {
        return minId;
    }

    public void setMinId(long minId) {
        this.minId = minId;
    }

    public long getMaxId() {
        return maxId;
    }

    public void setMaxId(long maxId) {
        this.maxId = maxId;
    }

    public int getThreadNum() {
        return threadNum;
    }

    public void setThreadNum(int threadNum) {
        this.threadNum = threadNum;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getItemId() {
        return itemId;
    }

    public void setItemId(int itemId) {
        this.itemId = itemId;
    }

    public int getVotePlayerTimes() {
        return votePlayerTimes;
    }

    public void setVotePlayerTimes(int votePlayerTimes) {
        this.votePlayerTimes = votePlayerTimes;
    }

    public int getVoteCropsTimes() {
        return voteCropsTimes;
    }

    public void setVoteCropsTimes(int voteCropsTimes) {
        this.voteCropsTimes = voteCropsTimes;
    }

    public String getdPath() {
        return dPath;
    }

    public void setdPath(String dPath) {
        this.dPath = dPath;
    }
}
